<?php
/**
 * Des: blog-code
 * Author: TonyChen
 * EMAIL: chendan316@gmail.com
 * DateTime: 17-2-21 下午1:03
 */
$file = getcwd() . '/SplFileInfo.php';

$splFileInfo = new \SplFileInfo($file);
$br = "\r\n";

echo 'getFilename: ' . $splFileInfo->getFilename();
echo $br;
echo 'getPath: ' . $splFileInfo->getPath();
echo $br;
echo 'getExtension: ' . $splFileInfo->getExtension();
echo $br;
echo 'getBasename: ' . $splFileInfo->getBasename();
echo $br;
echo 'getPathname: ' . $splFileInfo->getPathname();
echo $br;
//%o以八进制输出
echo 'getPerms: ' . substr(sprintf('%o', $splFileInfo->getPerms()), -4);
echo $br;
echo 'getInode: ' . $splFileInfo->getInode();
echo $br;
echo 'getSize: ' . $splFileInfo->getSize();
echo $br;
echo 'getOwner: ' . $splFileInfo->getOwner();
echo $br;
echo 'getGroup: ' . $splFileInfo->getGroup();
echo $br;
echo 'getATime: ' . $splFileInfo->getATime();
echo $br;
echo 'getMTime: ' . $splFileInfo->getMTime();
echo $br;
echo 'getCTime: ' . $splFileInfo->getCTime();
echo $br;
echo 'getType: ' . $splFileInfo->getType();
echo $br;
echo 'isWritable: ' . $splFileInfo->isWritable();
echo $br;
echo 'isReadable: ' . $splFileInfo->isReadable();
echo $br;
echo 'isExecutable: ' . $splFileInfo->isExecutable();
echo $br;
echo 'isFile: ' . $splFileInfo->isFile();
echo $br;
echo 'isDir: ' . $splFileInfo->isDir();
echo $br;
echo 'isLink: ' . $splFileInfo->isLink();
echo $br;
//echo 'getLinkTarget: ' . $splFileInfo->getLinkTarget();
//echo $br;
echo 'getRealPath: ' . $splFileInfo->getRealPath();
echo $br;
//var_dump($splFileInfo->getFileInfo());